home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / cpu / m6502 / ops4510.h < prev    next >
Text File  |  2000-05-08  |  3KB  |  80 lines

  1. /*****************************************************************************
  2.  *
  3.  *     ops4510.h
  4.  *     Addressing mode and opcode macros for 4510 CPU
  5.  *
  6.  *     Copyright (c) 2000 Peter Trauner, all rights reserved.
  7.  *   documentation preliminary databook
  8.  *     documentation by michael steil mist@c64.org
  9.  *     available at ftp://ftp.funet.fi/pub/cbm/c65
  10.  *
  11.  *     - This source code is released as freeware for non-commercial purposes.
  12.  *     - You are free to use and redistribute this code in modified or
  13.  *       unmodified form, provided you list me in the credits.
  14.  *     - If you modify this source code, you must add a notice to each modified
  15.  *       source file that it has been changed.  If you're a nice person, you
  16.  *       will clearly mark each change too.  :)
  17.  *     - If you wish to use this for commercial purposes, please contact me at
  18.  *       pullmoll@t-online.de
  19.  *     - The author of this copywritten work reserves the right to change the
  20.  *       terms of its usage and license at any time, including retroactively
  21.  *     - This entire notice must remain in the source code.
  22.  *
  23.  *****************************************************************************/
  24.  
  25. #define m65ce02 m4510
  26. #define m65ce02_ICount m4510_ICount
  27.  
  28. #define M4510_MEM(addr) (m4510.mem[(addr)>>13]+(addr))
  29.  
  30. #undef CHANGE_PC
  31. #define CHANGE_PC change_pc20(M4510_MEM(PCD))
  32.  
  33. /***************************************************************
  34.  *  RDOP    read an opcode
  35.  ***************************************************************/
  36. #undef RDOP
  37. #define RDOP() cpu_readop(m4510.mem[PCD>>13]+PCW++)
  38.  
  39. /***************************************************************
  40.  *  RDOPARG read an opcode argument
  41.  ***************************************************************/
  42. #undef RDOPARG
  43. #define RDOPARG() cpu_readop_arg(m4510.mem[PCD>>13]+PCW++)
  44.  
  45. /***************************************************************
  46.  *  RDMEM   read memory
  47.  ***************************************************************/
  48. #undef RDMEM
  49. #define RDMEM(addr) cpu_readmem20(M4510_MEM(addr))
  50.  
  51. /***************************************************************
  52.  *  WRMEM   write memory
  53.  ***************************************************************/
  54. #undef WRMEM
  55. #define WRMEM(addr,data) cpu_writemem20(M4510_MEM(addr),data)
  56.  
  57. #undef MAP
  58. #define MAP                                                                 \
  59. {                                                                            \
  60.     UINT16 low, high;                                                        \
  61.     low = m4510.low;                                                        \
  62.     high = m4510.high;                                                        \
  63.     m4510.low = m4510.a | (m4510.x<<8);                                     \
  64.     m4510.high = m4510.y | (m4510.z<<8);                                    \
  65.     m4510.a = low & 0xff;                                                    \
  66.     m4510.x = low >> 8;                                                     \
  67.     m4510.y = high & 0xff;                                                    \
  68.     m4510.z = high >> 8;                                                    \
  69.     m4510.mem[0] = (m4510.low & 0x1000) ? (m4510.low & 0xfff) << 8 : 0;     \
  70.     m4510.mem[1] = (m4510.low & 0x2000) ? (m4510.low & 0xfff) << 8 : 0;     \
  71.     m4510.mem[2] = (m4510.low & 0x4000) ? (m4510.low & 0xfff) << 8 : 0;     \
  72.     m4510.mem[3] = (m4510.low & 0x8000) ? (m4510.low & 0xfff) << 8 : 0;     \
  73.     m4510.mem[4] = (m4510.high & 0x1000) ? (m4510.high & 0xfff) << 8 : 0;    \
  74.     m4510.mem[5] = (m4510.high & 0x2000) ? (m4510.high & 0xfff) << 8 : 0;    \
  75.     m4510.mem[6] = (m4510.high & 0x4000) ? (m4510.high & 0xfff) << 8 : 0;    \
  76.     m4510.mem[7] = (m4510.high & 0x8000) ? (m4510.high & 0xfff) << 8 : 0;    \
  77.     CHANGE_PC;                                                                \
  78. }
  79.  
  80.